<template>
	<view class="my-search-container">
		<view class="my-search-box" @click="search" :style="{'border-radius':radius+'px'}">
			<uni-icons class="my-search-icons" type="search" size="18"></uni-icons>
			<text class="my-search-text">美的(Midea)</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: "mysearch",
		data() {
			return {

			};
		},
		// props用来接受来自于父组件的自定义参数
		// 如果需要针对属性进行控制，
		props: {
			"radius": {
				type: Number,
				default: 15
			}
		},
		// props:["radius"],
		methods: {
			search() {
				// 触发父组件自定义事件  click
				this.$emit("click")
			}
		},
		mounted() {
			console.log(this);
		}
	}
</script>

<style lang="scss">
	.my-search-box {
		background-color: #fff;
		height: 40px;
		display: flex;
		align-items: center;

		.my-search-icons {
			width: 20px;
			height: 20px;
			padding-left: 5px;
		}

		.my-search-text {
			font-size: 15px;
			color: darkgrey;
		}
	}
</style>